#include "stdafx.h"
#include "MasterServerSession.h"
#include "PacketHandler.h"
#include "ServerSessionManager.h"
#include "ServerSessionFactory.h"
#include "GameServer.h"
#include <PacketStruct_GM.h>
#include <Protocol_GM.h>

MasterServerSession::MasterServerSession()
{
}

MasterServerSession::~MasterServerSession()
{
}

VOID MasterServerSession::Init()
{
	ServerSession::Init();
}

VOID MasterServerSession::Release()
{
	ServerSession::Release();
}

VOID MasterServerSession::Update()
{
	ServerSession::Update();
}

VOID MasterServerSession::OnConnect( BOOL bSuccess, DWORD dwSessionIndex )
{
	ServerSession::OnConnect( bSuccess, dwSessionIndex );

	if( bSuccess )
	{
		SUNLOG( eFULL_LOG,  "[MasterServerSession::OnConnect] Connected to master server." );

		ServerSession::SendServerType();
	}
	else
	{
		//SUNLOG( eFULL_LOG,  "Can't connect to master server." );
	}
}

VOID MasterServerSession::OnDisconnect()
{
	printf( "Disconnected from master server." );

	ServerSession::OnDisconnect();
}

VOID MasterServerSession::OnRecv( BYTE *pMsg, WORD wSize )
{
	PacketHandler::Instance()->ParsePacket_GM( this, (MSG_BASE *)pMsg, wSize );
}
